<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Article/index')}">所有文章</a></li>
        <li class="active"><a href="{:url('Article/add')}">添加文章</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('Article/addPost')}">
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>文章标题</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="title">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">照片</label>
            <div class="col-sm-6 col-sm-10">
                <img style="width: 50px;height: 50px;" id="photo-1-preview">
            </div>
        </div>
        <div>
            <input id="photo-1" type="hidden" name="image" >
            <input id="photo-1-name" type="hidden" name="" title="图片名称">
            <a href="javascript:uploadOneImage('图片上传','#photo-1');">选择文件</a>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>文章作者</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="author">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>选择分类</label>
            <div class="col-md-6 col-sm-10">
                <select class="form-control" name="category_id">
                    <option value="">请选择分类</option>
                    <foreach name="category" item="vo">
                        <option value="{$vo.category_id}">{$vo.category_name}</option>
                    </foreach>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>是否推荐</label>
            <div class="col-md-6 col-sm-10">
                <input type="radio" name="is_recom" value="1"> 是
                <input type="radio" name="is_recom" value="2"> 否
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>是否显示</label>
            <div class="col-md-6 col-sm-10">
                <input type="radio" name="status" value="1"> 是
                <input type="radio" name="status" value="2"> 否
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>文章简介</label>
            <div class="col-md-6 col-sm-10">
                <input type="text" class="form-control" name="desc">
            </div>
        </div>

        <div class="form-group">
            <label class="col-sm-2 control-label"><span class="form-required">*</span>文章内容</label>
            <div class="col-md-6 col-sm-12">
                <script type="text/plain" id="content" name="content" style="height: 300px;"></script>
            </div>
        </div>

        <div class="col-sm-offset-2 col-sm-10">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:lang("SAVE")}</button>
            <a class="btn btn-default" href="{:url('Article/index')}">返回</a>
        </div>
    </form>

</div>
<script src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    var editorcontent = new baidu.editor.ui.Editor();
    editorcontent.render('content');
</script>
</body>
</html>